var pieDom = document.getElementById('pieChart');
var pieChart = echarts.init(pieDom);
var pieData = {
    title: '各产品贷款占比',
    legend: ['加盟宝', '升级宝', '贷款宝', '项目宝', '提货宝', '一级经销商融资产品'],
    data: [
      { value: 320, name: '加盟宝' },
      { value: 240, name: '升级宝' },
      { value: 149, name: '贷款宝' },
      { value: 100, name: '项目宝' },
      { value: 59, name: '提货宝' },
      { value: 400, name: '一级经销商融资产品' }
    ]
}
var pieOption = {
    title: {
      text: pieData.title,
      x: 'left'
    },
    tooltip: {
      trigger: 'item',
      formatter: '{b} : {c} ({d}%)'
    },
    legend: {
      left: 'center',
      bottom: '10',
      data: pieData.legend
    },
    color,
    calculable: true,
    series: [
      {
        type: 'pie',
        roseType: 'radius',
        radius: [15, 95],
        center: ['50%', '38%'],
        data: pieData.data,
        animationEasing: 'cubicInOut',
        animationDuration: 2600
      }
    ]
  }

  pieChart.setOption(pieOption)